package com.controller;

import com.service.FloorService;
import com.service.RoomService;
import com.service.RoomTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author mornd
 * @date 2020/11/30 - 14:16
 */
@Controller
public class IndexInitController {
    @Autowired
    private FloorService floorService;
    @Autowired
    private RoomService roomService;


    @RequestMapping("/initIndex")
    public String initIndexPage(Model model) {
        //加载楼层列表
        model.addAttribute("floorList", floorService.findFloorList(null));
        //加载房间列表
        model.addAttribute("roomList", roomService.findRoomList(null));
        return "forward:/index.jsp";
    }
}
